<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ออกรายงาน</title>
<link href="<?=base_url()?>res/css/css.css" rel="stylesheet" type="text/css" />
<style  >
    body{background-color: #fff;}
</style>
</head>

<body>
<?php 
         $URL = $CI->uri->uri_to_assoc();
         $option_type = trim( mysql_escape_string($URL["type"]) );
         $report_code = array();
         switch ($option_type){
             case "1":
                 $report_code = $CI->collegian_model->get_collegian_signin_activity($act_id , 1);
                 break;
             case "2":
                 $report_code = $CI->collegian_model->get_collegian_signin_activity($act_id , 2);
                 break;
             case "3":
                 $report_code = $CI->collegian_model->get_collegian_signin_activity($act_id , 3);
                 break;
         }
        
?>

        <?php if(  $option_type == 2){ ?>
        <table style="margin: 0 auto"  align="center"  class="formtable" width="94%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <th colspan="8" align="center" valign="middle">
                &nbsp;<b> แสดงข้อมูลนักศึกษาเข้าร่วมกิจกรรม</b>
            </th>
          </tr>
          <tr>
            <th width="9%" align="center" valign="middle">รหัส</th>
            <th width="15%" align="center" valign="middle">ชื่อ-สกุล</th>
            <th width="12%" align="center" valign="middle">โปรแกรมวิชา</th>
            <th width="3%" align="center" valign="middle">ชั้นปี</th>
          </tr>
          <?php foreach($report_code->result_array() as $row){  ?>
          <tr>
            <td align="center" valign="middle">&nbsp;<b><?=$row["collegian_code"]?></b></td>
            <td align="left" valign="middle">&nbsp;<?=$row["collegian_name"]?></td>
            <td align="center" valign="middle">&nbsp;<?=$row["major_title"]?></td>
            <td align="center" valign="middle">&nbsp;<?=  get_level($row["collegian_code"])?></td>
          </tr>
          <?php } ?>
        </table>
        <?php } ?>
        <?php if($option_type == 3){ ?>
        <table style="margin: 0 auto"  align="center"  class="formtable" width="94%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <th colspan="8" align="center" valign="middle">
                &nbsp;<b>แสดงข้อมูลนักศึกษาไม่เข้าร่วมกิจกรรม :  <?=$report_code->row(0)->act_title?> </b>
            </th>
          </tr>
          <tr>
            <th width="9%" align="center" valign="middle">รหัส</th>
            <th width="15%" align="center" valign="middle">ชื่อ-สกุล</th>
            <th width="12%" align="center" valign="middle">โปรแกรมวิชา</th>
            <th width="3%" align="center" valign="middle">ชั้นปี</th>
          </tr>
          <?php foreach($report_code->result_array() as $row){  ?>
          <tr>
            <td align="center" valign="middle">&nbsp;<b><?=$row["collegian_code"]?></b></td>
            <td align="left" valign="middle">&nbsp;<?=$row["collegian_name"]?></td>
            <td align="center" valign="middle">&nbsp;<?=$row["major_title"]?></td>
            <td align="center" valign="middle">&nbsp;<?=  get_level($row["collegian_code"])?></td>
          </tr>
          <?php } ?>
        </table>
        <?php } ?>
        <div style="height:30px"></div>
</body>
<script>
            window.print();
</script>
</html>
